package util;

import java.awt.Rectangle;

public class MyRectangle {
    private Rectangle rectangle1;
    private Rectangle rectangle2;

    public MyRectangle(MyPosition myPosition, MyPosition myPosition2) {
        rectangle1 = new Rectangle(myPosition.getX(), myPosition.getY(), myPosition.getWidth(), myPosition.getHeight());
        rectangle2 = new Rectangle(myPosition2.getX(), myPosition2.getY(), myPosition2.getWidth(),
                myPosition2.getHeight());
    }

    public boolean check() {
        return rectangle1.intersects(rectangle2);
    }
}
